import java.util.Arrays;
import java.util.Date;
import static java.lang.Math.*;
/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 刘远望
 * Date: 2025-03-13
 * Time: 21:21
 */
class Student{
    //private String name;
    String name;//默认类型default 在包中使用
    private int age;
    private String stuNum;
    public static String className;
    public Student(){
        this.name = "张三";
        this.age = 18;
        this.stuNum = "202430410062";
    }
    //类似于接口
    public void setName(String name){
        this.name = name;
    }
    public String getName(){
        return this.name;
    }
    public void eat(){
        System.out.println("吃的行为");
    }
    private void func(){
        //其他业务操作
        System.out.println("这个方法是为本类其他访问服务的不对外公开");
    }
}
public class Test {
    public static int count = 10;
    public static void main(String[] args) {
        Test test1 = new Test();
        Test.count++;
        Test test2 = new Test();
        Test.count++;
        Test test3 = new Test();
        Test.count--;


        Test.count++;
        System.out.println(Test.count);
    }
    public static void main4(String[] args) {
        Student student = null;
        Student.className = "1班";
        student.className = "1班";
        System.out.println(Student.className);//不依赖于对象，静态的
        System.out.println(student.className);//可以通过对象名来访问
    }
    public static void main3(String[] args) {
        double x = 30;
        double y = 40;
        //静态导入的方式写起来方便
        //double result = Math.sqrt(Math.pow(x , 2) + Math.pow(y , 2));
        double result = sqrt(pow(x , 2) + pow( y , 2));
        System.out.println(result);
    }
    public static void main2(String[] args) {
        int[] arr = { 1, 2 , 3 , 4 ,5 ,6};
        System.out.println(Arrays.toString(arr));
        Date date = new Date();//对应包
        java.sql.Date date1 = new java.sql.Date(10);
    }
    public static void main1(String[] args) {
        Student student = new Student();
        //System.out.println(student.name);被private修饰不能被访问
        student.setName("李四");//可以这样访问
        System.out.println(student.getName());
    }
}
